package com.woody.aggregate.domain.saas;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.toolkit.ChainWrappers;
import com.woody.aggregate.infrastructure.saas.entity.SaasShopIndustry;
import com.woody.aggregate.infrastructure.saas.mapper.SaasShopIndustryMapper;
import com.woody.aggregate.saas.dto.CodeQueryDTO;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * &copy; All rights Reserved
 *
 * @author wénkǎi.zhāng
 */
@Component
public class SaasShopIndustryManager extends ServiceImpl<SaasShopIndustryMapper, SaasShopIndustry> {

    /**
     * 根据行业编码右模糊查询行业(获取编码本级及所有子行业)
     *
     * @param code
     * @return
     */
    public List<SaasShopIndustry> likeRightByCode(String code) {
        return ChainWrappers.lambdaQueryChain(getBaseMapper()).likeRight(SaasShopIndustry::getCode, code).list();

    }
}
